import pytest
from utils.client import APIClient
from api_test_root.api.api_login import Api_Login




@pytest.fixture(scope='session')
def client():
    headers= {'content-type':'application/json; charset=utf-8'}
    api_client = APIClient('http://hxzhan.rtcloud.com:32111',headers=headers)
    login_api = Api_Login(api_client)
    res = login_api.login(0)
    token = res['data']['token']
    headers = {
        "tm-token":token
    }
    api_client.session.headers.update(headers)
    return api_client

